﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace University.Workshop.WinApp.Sale
{
    public partial class FormSaleView : Form
    {
        public FormSaleView()
        {
            InitializeComponent();
        }
        private static FormSaleView instance;

        public static FormSaleView Intance
        {
            get
            {
                if (instance == null)
                {
                    instance = new FormSaleView();
                }
                return instance;
            }
        }

        public void GoToMainView()
        {
            tabControlSale.SelectedTab = tabPageMain;
        }

        public void OpenControl(UserControl control)
        {
            panelSale.Controls.Clear();
            control.Dock = DockStyle.Fill;
            panelSale.Controls.Add(control);
        }

        private void buttonRegisterSale_Click(object sender, EventArgs e)
        {
            SaleRegister main = new SaleRegister();
            OpenControl(main);
            tabControlSale.SelectedTab = tabPageVariable;
        }

        private void buttonCloseSaleManager_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
